home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / DrawBBox.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  1.8 KB  |  81 lines

  1. #include <intuition/intuition.h>
  2. #include <graphics/rastport.h>
  3. #include <proto/gadtools.h>
  4. #include <extras/gui.h>
  5.  
  6. /****** extras.lib/OBSOLETEDrawBevelBoxes ******************************************
  7. *
  8. *   NAME
  9. *       DrawBevelBoxes -- draw a series of scaled bevel boxws.
  10. *
  11. *   SYNOPSIS
  12. *       DrawBevelBoxes(Window, VisualInfo, BBoxes, NumBoxes,
  13. *             XScale, YScale);  
  14. *
  15. *       void DrawBevelBoxes(struct Window *, APTR, 
  16. *             struct BevelBox *, LONG, float, float);
  17. *
  18. *   FUNCTION
  19. *       Draws a series of scaled boxes.
  20. *
  21. *   INPUTS
  22. *       Win - the Window to draw the bevel boxes in.
  23. *       VI - VisualInfo previously obtained by 
  24. *            gadtools.library/GetVisualInfoA()
  25. *       BBoxes - pointer to an array of struct BevelBox.
  26. *       NumBoxes - the number of entries in the array.
  27. *       XScale - 
  28. *       YScale - 
  29. *
  30. *   EXAMPLE
  31. *
  32. *   NOTES
  33. *
  34. *   BUGS
  35. *
  36. *   SEE ALSO
  37. *
  38. ******************************************************************************
  39. *
  40. */
  41.  
  42. void DrawBevelBoxes(struct Window *Win, APTR VI, struct BevelBox *BBox,
  43.                     LONG NumBoxes, float XScale, float YScale)
  44. {
  45.   struct  RastPort *rp;
  46.   ULONG   l;
  47.   LONG    x,y;
  48. //  LONG    bx1,by1, bx2,by2;
  49.   float   xm,ym;
  50.   struct  TagItem bbtags[]=
  51.   {
  52.     GTBB_Recessed   ,TRUE,
  53.     GT_VisualInfo ,   0,
  54.     TAG_DONE,
  55.   };
  56.  
  57.   rp  =Win->RPort;
  58.   x   =Win->BorderLeft;
  59.   y   =Win->BorderTop;
  60.   
  61.   bbtags[1].ti_Data=(ULONG)VI;
  62.  
  63.   for(l=0;l<NumBoxes;l++)
  64.   {
  65.     if(BBox[l].Scale & BBSCALE_WIDTH)
  66.       xm=XScale;
  67.     else
  68.       xm=1.0;
  69.     
  70.     if(BBox[l].Scale & BBSCALE_HEIGHT)
  71.       ym=YScale;
  72.     else
  73.       ym=1.0;
  74.     
  75.     DrawBevelBoxA(rp,x+(LONG)(BBox[l].X     * XScale),y+(LONG)(BBox[l].Y      * YScale), 
  76.                        (LONG)(BBox[l].Width * xm)    ,  (LONG)(BBox[l].Height * ym),
  77.                         bbtags);
  78.   }
  79. }
  80.  
  81.